package com.touni.designpattern.filterpattern.criteria;

import com.touni.designpattern.filterpattern.PersonModel;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName : CriteriaMale
 * @Description :
 * @Author : lwq
 * @Date: 2020-11-10 14:59
 */
public class CriteriaMale implements Criteria {
    @Override
    public List<PersonModel> filterPerson(List<PersonModel> personModelList) {
        List<PersonModel> result = new ArrayList<>();
        for (PersonModel personModel : personModelList){
            if (personModel.getGender().equalsIgnoreCase("男")){
                result.add(personModel);
            }
        }
        return result;
    }
}
